tools/libxc: Avoid generating inappropriate zero-content records
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 30 Mar 2017 16:32:32 +0000 (17:32 +0100)
committerWei Liu <wei.liu2@citrix.com>
Thu, 6 Apr 2017 09:37:32 +0000 (10:37 +0100)
commit72efb1df629421037e2795f5529210aaa95ec72e
tree7b339305622c6bd04b3f286a92702e0fd03bad77
parent119ee4d77377aa1fc62efdadc1cc87df4f1270bf
tools/libxc: Avoid generating inappropriate zero-content records

The code as written attempted to elide zero-content records, as such records
serve no purpose but come with a performance hit.  Unfortunately, in the case
where the hypervisor reported max size is non-zero, but the actual size is
zero, the record is not elided.

This previously tripped up the sanity checks in the restore side of migration,
but as the underlying reasons for eliding the records in the first place are
still valid, fix the elision logic.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
tools/libxc/xc_sr_save_x86_hvm.c
tools/libxc/xc_sr_save_x86_pv.c